{% load djblets_forms %}
{% load djblets_utils %}
{%    if field.is_hidden %}
   {{field}}
{%    else %}
{%     with field|form_field_has_label_first as label_first %}
   <div class="form-row{% if not label_first %} checkbox-row{% endif%}{% if field.errors %} error{% endif %}">
    {{field.errors}}
    {% if not label_first %}{{field}}{% endif %}
    {% label_tag field %}
    {% if label_first %}{{field}}{% endif %}
    {% if field.help_text %}<p class="help">{{field.help_text}}</p>{% endif %}
    {% if form.disabled_reasons|contains:fieldname %}<p class="disabled-reason">{{form.disabled_reasons|getitem:fieldname|safe}}</p>{% endif %}
   </div>
{%     endwith %}
{%    endif %}
